This invention relates to a computer system. In one embodiment, the invention provides a solution to throughput constraint of a computer system by means of a hybrid lock and queue which autonomically adjusts.
It is common to provide a computer system that is able to execute multiple tasks in parallel. A task comprises multiple threads and the computer system is also able to execute threads of execution of instructions, which in sequence can correspond to the execution of a single task. A thread has the characteristic of encapsulation of state data concerned with the functions of which it is capable. The computer system is a multiprocessing system in that it has a number of processors and threads can execute on any processor.
The processing of a task can begin by executing instructions on one processor as one thread, then switch to executing another thread on the same processor while the first thread waits. This second thread executes to its completion at which point it signals to the first thread so that it can complete its execution. The capability can extend to provide a virtual execution in parallel of many tasks and many threads.
Additionally such a computer system can be configured so that during execution of a task, where there is a switch of execution to another thread, there may in addition be a switch to another processor instead of execution remaining on the same processor. This can provide a real execution rather than a virtual execution of threads in parallel. The computer system therefore has the overall capability to execute a task by multi-threading execution within the same processor and across multiple processors and this can extend to the execution in parallel of many tasks, many threads and on many processors.
The computer system is provided with a program object that provides a locking capability whereby one thread of execution can ensure exclusive access to a storage area. The execution of all other threads which require to access to a locked storage area have to wait until the lock is released. This locking capability is effective both to threads which execute on the same processor and to those on different processors.
The computer system also has means to allow the throughput of task processing to be controlled and as a result has certain performance characteristics. Tasks can be assigned relative priorities. A high priority task is required to complete execution at the expense of delaying of lower priority tasks which execute in parallel. When a lock becomes free and there are a number of threads waiting for use of the lock, the thread with the highest priority is resumed and given the lock even though it may not have waited the longest duration for its use.
The computer system has a performance characteristic that when a lock is released, threads which execute on the same processor can be resumed with very little processor time overhead. However threads on different processors can be resumed only with a very large processor time overhead. The capabilities and characteristics of this computer system mean that throughput of the computer system as a whole can be constrained by a high number of threads which execute on the same processor and that this constraint cannot be significantly relieved by incorporating the use of more processors due to the very large processor time overhead involved in their exploitation.
It is therefore an object of the invention to improve upon the known art.